3ddb79c259jh8hE7vre_8NuE7nwNSA xen/include/xen/config.h
3eb165e0eawr3R-p2ZQtSdLWtLRN_A xen/include/xen/console.h
3ddb79c1V44RD26YqCUm-kqIupM37A xen/include/xen/ctype.h
+4194efbdvxUXjCLobbopgLOojisO4Q xen/include/xen/debugger_hooks.h
3ddb79c05DdHQ0UxX_jKsXdR4QlMCA xen/include/xen/delay.h
3ddb79c2O729EttZTYu1c8LcsUO_GQ xen/include/xen/elf.h
3ddb79c0HIghfBF8zFUdmXhOU8i6hA xen/include/xen/errno.h
#include <asm/uaccess.h>
#include <asm/i387.h>
#include <asm/pdb.h>
+#include <xen/debugger_hooks.h>
extern char opt_nmi[];
return;
}
+ if (debugger_trap(trapnr, regs))
+ return;
+
show_registers(regs);
panic("CPU%d FATAL TRAP: vector = %d (%s)\n"
"[error_code=%08x]\n",
struct guest_trap_bounce *gtb = guest_trap_bounce+smp_processor_id();
trap_info_t *ti;
-#ifdef XEN_DEBUGGER
- if ( pdb_initialized && pdb_handle_exception(3, regs) == 0 )
+ if (debugger_trap(3, regs))
return;
-#endif
if ( (regs->cs & 3) != 3 )
{
printk("System needs manual reset.\n");
printk("************************************\n");
+ debugger_trap(8, NULL);
+
/* Lock up the console to prevent spurious output from other CPUs. */
console_force_lock();
return;
}
+ if (debugger_trap(14, regs))
+ return;
+
if ( addr >= PAGE_OFFSET )
{
unsigned long page;
#endif
}
-#ifdef XEN_DEBUGGER
- if ( pdb_page_fault_possible )
- {
- pdb_page_fault = 1;
- /* make eax & edx valid to complete the instruction */
- regs->eax = (long)&pdb_page_fault_scratch;
- regs->edx = (long)&pdb_page_fault_scratch;
- return;
- }
-#endif
-
show_registers(regs);
panic("CPU%d FATAL PAGE FAULT\n"
"[error_code=%08x]\n"
return;
}
+ if (debugger_trap(13, regs))
+ return;
+
die("general protection fault", regs, error_code);
}
static void unknown_nmi_error(unsigned char reason, struct xen_regs * regs)
{
+ if (debugger_trap(2, regs))
+ return;
+
printk("Uhhuh. NMI received for unknown reason %02x.\n", reason);
printk("Dazed and confused, but trying to continue\n");
printk("Do you have a strange power saving mode enabled?\n");
--- /dev/null
+
+#ifndef __DEBUGGER_HOOKS_H__
+#define __DEBUGGER_HOOKS_H__
+
+static inline int debugger_trap(int type, struct xen_regs *regs)
+{
+ int ret = 0;
+
+#ifdef XEN_DEBUGGER
+ switch (type) {
+ case 3:
+ if ( pdb_initialized && pdb_handle_exception(type, regs) == 0 )
+ return 1;
+ break;
+ case 14:
+ if ( pdb_page_fault_possible )
+ {
+ pdb_page_fault = 1;
+ /* make eax & edx valid to complete the instruction */
+ regs->eax = (long)&pdb_page_fault_scratch;
+ regs->edx = (long)&pdb_page_fault_scratch;
+ return 1;
+ }
+ break;
+ }
+#endif
+
+#if 0
+ extern int kdb_trap(int, int, struct xen_regs *);
+ if ((ret = kdb_trap(type, 0, regs)))
+ return ret;
+#endif
+
+ return ret;
+}
+
+#endif /* __DEBUGGER_HOOKS_H__ */